package tr.edu.metu.is.mega.common.dto;

import java.util.Date;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * Data structure class for activities.
 */
public class ActivityDTO extends BaseDTO {

    private static final long serialVersionUID = -170332606764855040L;

    public static final String FIELD_DESCRIPTION = "description";

    public static final String FIELD_DUEDATE = "dueDate";

    public static final String FIELD_ALERT_TIME = "alertTime";

    public static final String FIELD_TYPE = "type";

    public static final String FIELD_COURSE = "course";

    @NotNull
    @Size(max = 100)
    private String description;

    @NotNull
    private Date dueDate;

    @NotNull
    private Date alertTime;

    @NotNull
    private ActivityType type;

    public ActivityDTO() {
    }

    /**
     * Returns description.
     * 
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets description value.
     * 
     * @param description the description to set
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * Returns dueDate.
     * 
     * @return the dueDate
     */
    public Date getDueDate() {
        return dueDate;
    }

    /**
     * Sets dueDate value.
     * 
     * @param dueDate the dueDate to set
     */
    public void setDueDate(Date dueDate) {
        this.dueDate = dueDate;
    }

    /**
     * Returns alarmTime.
     * 
     * @return the alarmTime
     */
    public Date getAlertTime() {
        return alertTime;
    }

    /**
     * Sets alarmTime value.
     * 
     * @param alarmTime the alarmTime to set
     */
    public void setAlertTime(Date alarmTime) {
        this.alertTime = alarmTime;
    }

    /**
     * Returns type.
     * 
     * @return the type
     */
    public ActivityType getType() {
        return type;
    }

    /**
     * Sets type value.
     * 
     * @param type the type to set
     */
    public void setType(ActivityType type) {
        this.type = type;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return "Description=" + description + "\n\t Due date=" + dueDate + "\n\t Alert Time=" + alertTime + "\n\t Type=" + type + "";
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object obj) {
        if (obj instanceof ActivityDTO) {
            ActivityDTO other = (ActivityDTO) obj;
            return other.getPkid() == getPkid();
        }
        return super.equals(obj);
    }
}
